package com.bbs.toutiao.exception;


import lombok.Getter;



@Getter
public enum ExceptionEnum  {
    // 数据操作错误定义
    SUCCESS(200, "成功!"),
    BODY_NOT_MATCH(400, "请求的数据格式不符!"),
    SIGNATURE_NOT_MATCH(401, "请求的数字签名不匹配!"),
    USER_NOT_PASSWORD(401, "账户名或者密码不对"),
    NOT_NULL(401, "数据不能为空"),
    NOT_FOUND(404, "未找到该资源!"),
    NOT_FOUND_USER(404, "用户不存在"),
    NOT_FOUND_ARTICLE(404, "文章不存在"),
    NOT_FOLLOWS(404,"没有关注者"),
    NOT_FAVORS(404,"没有收藏内容"),
    NOT_FOUND_CODE(404, "验证码已过期"),
    NOT_CODE(404,"验证码为空"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误!"),
    SERVER_BUSY(503, "服务器正忙，请稍后再试!"),
    TOKEN_FONT_ERROR(400,"token格式错误"),
    TOKEN_NOT_NULL(404,"token不能为空"),
    TOKEN_TIME_OUT(400,"token过期"),
    PASSWORD(400,"新密码不能和旧密码相同"),
    LARGE_NO_TO(404,"权限不够"),
    USER_OFF(409,"用户已被封禁"),
    USER_FOLLOWS(200,"取消关注成功"),
    USER_OFF_A(409,"账号已被封禁七天"),
    USER_OFF_B(409,"用户已被永久封禁"),
    PHONE_MAN(400,"手机号已注册"),
    NO_FRIEND(404,"非互关不能发送消息"),
    MSG_ERROR(401,"不能同时发送图片和文字"),
    REPEAT_PHONE(400,"手机号已注册，请登陆");


    /**
     * 错误码
     */
    private  Integer resultCode;
    /**
     * 错误描述
     */
    private  String resultMsg;

    ExceptionEnum(Integer resultCode, String resultMsg) {
        this.resultCode = resultCode;
        this.resultMsg = resultMsg;
    }

    public void setResultCode(Integer resultCode) {
        this.resultCode = resultCode;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }

    @Override
    public String toString() {
        return "ExceptionEnum{" +
                "resultCode=" + resultCode +
                ", resultMsg='" + resultMsg + '\'' +
                '}';
    }
}
